org.eclipse.vtp.framework.engine.runtime
Class Execution

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.runtime.Scope
      extended by org.eclipse.vtp.framework.engine.runtime.Execution
All Implemented Interfaces:
IExecution

public class Execution
extends Scope
implements IExecution

Implementation of the execution scope and context.

Author:
Lonnie Pryor

Nested Class Summary
protected  class Execution.Context
          Implementation of the generic context.
 
Field Summary
protected  Execution.Context context
          The generic context implementation.
protected  Session session
          The owner of this execution.
 
Constructor Summary
Execution(Session session, IExecutionDescriptor descriptor)
          Creates a new Execution.
 
Method Summary
 void dispose()
          Disposes this execution.
 java.lang.String getExecutionID()
          Returns the ID of this execution sequence.
protected  java.util.Collection getServices(java.lang.String identifier)
           
 ISession getSession()
          Returns the session that created this execution.
 boolean hasNextStep()
          Returns true if there are more steps to perform in the process.
 boolean isNextStepBlocking()
          Returns true if there is at least one step to perform and the next step may block across executions.
 java.lang.Object[] lookupAllServices(java.lang.String identifier)
          Returns an array containing all the services registered under the specified identifier.
 java.lang.Object lookupService(java.lang.String identifier)
          Looks up the service selected for the specified identifier or null if no such service exists.
 ICommand nextStep()
          Returns the next step in the process.
 void takeNextStep()
           
 
Methods inherited from class org.eclipse.vtp.framework.engine.runtime.Scope
getServiceInstance, lookupAllInScope, lookupInScope, registerImplicitServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected final Session session
The owner of this execution.


context

protected final Execution.Context context
The generic context implementation.

Constructor Detail

Execution

public Execution(Session session,
                 IExecutionDescriptor descriptor)
Creates a new Execution.

Parameters:
session - The owner of this execution.
descriptor - The execution descriptor.
Throws:
java.lang.NullPointerException - If the supplied session is null.
java.lang.NullPointerException - If the supplied descriptor is null.
Method Detail

getServices

protected java.util.Collection getServices(java.lang.String identifier)
Specified by:
getServices in class Scope

getExecutionID

public java.lang.String getExecutionID()
Description copied from interface: IExecution
Returns the ID of this execution sequence.

Specified by:
getExecutionID in interface IExecution
Returns:
The ID of this execution sequence.

lookupService

public java.lang.Object lookupService(java.lang.String identifier)
                               throws java.lang.NullPointerException
Description copied from interface: IExecution
Looks up the service selected for the specified identifier or null if no such service exists.

Specified by:
lookupService in interface IExecution
Parameters:
identifier - The identifier of the service to look up.
Returns:
The service selected for the specified identifier or null if no such service exists.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

lookupAllServices

public java.lang.Object[] lookupAllServices(java.lang.String identifier)
                                     throws java.lang.NullPointerException
Description copied from interface: IExecution
Returns an array containing all the services registered under the specified identifier.

Specified by:
lookupAllServices in interface IExecution
Parameters:
identifier - The identifier of the services to look up.
Returns:
An array containing all the services registered under the specified identifier.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

hasNextStep

public boolean hasNextStep()
Description copied from interface: IExecution
Returns true if there are more steps to perform in the process.

Specified by:
hasNextStep in interface IExecution
Returns:
True if there are more steps to perform in the process.

isNextStepBlocking

public boolean isNextStepBlocking()
Description copied from interface: IExecution
Returns true if there is at least one step to perform and the next step may block across executions.

Specified by:
isNextStepBlocking in interface IExecution
Returns:
True if there is at least one step to perform and the next step may block across executions

nextStep

public ICommand nextStep()
                  throws java.lang.IllegalStateException
Description copied from interface: IExecution
Returns the next step in the process.

Specified by:
nextStep in interface IExecution
Returns:
The next step in the process.
Throws:
java.lang.IllegalStateException - If there are no more steps in this process.

takeNextStep

public void takeNextStep()
                  throws java.lang.IllegalStateException,
                         java.lang.RuntimeException
Throws:
java.lang.IllegalStateException
java.lang.RuntimeException

getSession

public ISession getSession()
Description copied from interface: IExecution
Returns the session that created this execution.

Specified by:
getSession in interface IExecution
Returns:
The session that created this execution.

dispose

public void dispose()
Description copied from interface: IExecution
Disposes this execution.

Specified by:
dispose in interface IExecution